<!DOCTYPE html>
<html>
<head>
    <title>登录</title>
    <meta charset="UTF-8">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<h2>登录</h2>
<form id="loginForm" method="POST">
    <label for="account">账号:</label>
    <input type="text" id="account" name="account" required><br><br>

    <label for="password">密码:</label>
    <input type="password" id="password" name="password" required><br><br>

    <input type="button" value="登录" onclick="login()">
</form>

<script>
    function login() {
        var account = document.getElementById("account").value;
        var password = document.getElementById("password").value;

        $.ajax({
            url: "/login",
            type: "POST",
            data: {
                account: account,
                password: password
            },
            success: function(response) {
                // 处理登录成功后的逻辑
                console.log(response);
            },
            error: function(error) {
                // 处理登录失败后的逻辑
                console.log(error);
            }
        });
    }
</script>
</body>
</html>
